package dk.au.cs.bdsi;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

/**
 * Simple Echo service, bound to /Echo, which replies
 * whatever is appended after a trailing slash, back to the user.
 * 
 * @author Michael Dahl (micdah@cs.au.dk)
 * @version 2010-12-07 Initial implementation
 * @since 0.0.1
 * 
 * @TODO Really ought to use POST, as that is the correct way of receiving arbitrary
 * 		input from the user.
 *
 */
@Path("/Echo/{message}")
public class EchoService {
	/**
	 * Just echoes whatever you gives it, back
	 * 
	 * @param message Message to echo back
	 * @return message
	 */
	@GET
	@Produces("text/plain")
	public String echo(@PathParam("message") String message) {
		return message;
	}
}
